# 定义基础镜像
FROM bengfu/jdk8_image:latest

# 定义维护者信息
LABEL maintainer="antball"

WORKDIR /usr/local/

#会在宿主机创建一个匿名卷挂载到容器的这个目录上
#VOLUME ["/usr/local/tomcat/logs"]
#VOLUME ["/usr/local/tomcat/conf"]
#VOLUME ["/usr/local/tomcat/mywebapps"]

#VOLUME ["/usr/local/tomcat/conf/server.xml"]
#VOLUME ["/usr/local/tomcat/conf/Catalina/localhost"]

#定义构建时的参数
ARG TOMCAT_TAR=apache-tomcat-8.5.40.tar.gz

#添加宿主机的jdk 到容器中的指定目录
COPY ./apache-tomcat-8.5.40.tar.gz ./

RUN  tar xzvf apache-tomcat-8.5.40.tar.gz -C ./  \
#mv apache-tomcat-8.5.40 tomcat \
  && ln -s apache-tomcat-8.5.40 tomcat \
  && rm -r apache-tomcat-8.5.40.tar.gz

#EXPOSE 8080

CMD /usr/local/apache-tomcat-8.5.40/bin/catalina.sh run
